package cn.zf233.xcloud.web;

import cn.zf233.xcloud.commom.Const;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

/**
 * Created by zf233 on 2021/5/12
 * 会话跳转控制器
 */
@Controller
public class SessionController {

    @RequestMapping("/")
    public String sessionController(HttpSession session) {
        Object currentUser = session.getAttribute(Const.CURRENT_USER);
        if (currentUser != null) {
            return "redirect:/user/jump/home";
        }
        return "redirect:/user/jump/index";
    }
}